<?php
include ('template/header.php');
$id_proyecto = $_GET['id_proyecto'];
include("db_config.php");
$link = Conectarse();
?>
<?php
$id_alumno = $_GET['id_alumno'];
$result = mysql_query("select * from proyecto where id_proyecto='$id_proyecto'", $link) or die("error 1");
$a = 0;
$res = mysql_fetch_assoc($result);
    $usrasesor = $res['usrasesor'];

$n_pro = mysql_query("select usuario from asesor where usuario='$usrasesor'") or die("error2");
if (mysql_fetch_array($n_pro) > 0) {
    ?>
    <script language="javascript">alert ('Este alumno ya tiene un asesor asignado, debe ir a modificar asesor'); </script>
    <script type="text/javascript"> window.location="lista_alumnos.php"</script>
    <?php
} else {
    ?>
    <div id="content">
        <div id="breadcrumb">Inicio &raquo; Ver Asesores</div>
        <div id="titulo">Ver Asesores</div>

        <?php
//    if(isset($_POST['p']))
//  		$p=$_POST['p'];
        $instruccion = "  select id_asesor,nombre, apellido, email, helun,hemar,hemie,hejue,hevie,hslun,hsmar,hsmie,hsjue,hsvie,extension,especialidad,stock from asesor where stock < 2";
        $consulta = mysql_query($instruccion, $link)
                or die("Fallo en la consulta");
        // $resultado = mysql_fetch_array ($consulta);

        $i = 0;
        while ($resultado = mysql_fetch_array($consulta)) {
            $id_asesor = $resultado['id_asesor'];

            $i++;
            ?>
            <table width="100%" border="0">
                <tr>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><strong>Nombre: </strong></td>
                    <td colspan="2"  align="left" style="border:1px solid #ededed" ><?php echo $resultado['nombre'] ?></td>
                    <td colspan="2"  align="left" style="border:1px solid #ededed" ><strong>Accion</strong></td>
                </tr>
                <tr>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><strong>Apellido: </strong></td>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><?php echo $resultado['apellido'] ?></td>
                    <td colspan="2"  align="center" style="border:1px solid #ededed"><a href="conf_asigasesor.php?id_asesor=<?php echo $id_asesor ?>&id_proyecto=<?php echo $id_proyecto ?>"><img src="IMG/aceptar.png" width="118" height="53" /></a></td>
                </tr>
                <tr>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><strong>Email: </strong> </td>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><?php echo $resultado['email']; ?></td>
                    <td colspan="2"  >&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><strong>Extension: </strong> </td>
                    <td colspan="2"  align="left" style="border:1px solid #ededed"><?php echo $resultado['extension']; ?></td>
                    <td colspan="2"  >&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="2"  ><strong>Horario: </strong></td>
                    <td colspan="2">&nbsp; </td>
                    <td colspan="2" >&nbsp;</td>
                </tr>
                <tr>
                    <td width="12%"  align="left" style="border:1px solid #ededed"><strong>Dia</strong></td>
                    <td width="15%"  align="left" style="border:1px solid #ededed"><div align="center"><strong>Lunes</strong></div></td>
                    <td width="19%"  align="left" style="border:1px solid #ededed"><div align="center"><strong>Martes</strong></div></td>
                    <td width="18%"  align="left" style="border:1px solid #ededed"><div align="center"><strong>Miercoles</strong></div></td>
                    <td width="18%"  align="left" style="border:1px solid #ededed"><div align="center"><strong>Jueves</strong></div></td>
                    <td width="18%"  align="left" style="border:1px solid #ededed"><div align="center"><strong>Viernes</strong></div></td>
                </tr>
                <tr>
                    <td width="12%"  align="left" style="border:1px solid #ededed"><strong>H.Entrada</strong></td>
                    <td width="15%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['helun']; ?></td>
                    <td width="19%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hemar']; ?></td>
                    <td width="18%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hemie']; ?></td>
                    <td width="18%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hejue']; ?></td>
                    <td width="18%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hevie']; ?></td>
                </tr>
                <tr>
                    <td width="12%"  align="center" style="border:1px solid #ededed"><strong>H.Salida</strong></td>
                    <td width="15%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hslun']; ?></td>
                    <td width="19%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hsmar']; ?></td>
                    <td width="18%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hsmie']; ?></td>
                    <td width="18%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hsjue']; ?></td>
                    <td width="18%"  align="center" style="border:1px solid #ededed"><?php echo $resultado['hsvie']; ?></td>
                </tr>


                <tr><strong>---------------------------------------------------------------------------------------------------------</strong>				</tr>
            </table>
            <?php
        }
        ?>
    </div>

<?php } ?>

